/*
    2D FDTD simulator
    Copyright (C) 2019 Emilia Blåsten

    This program is free software: you can redistribute it and/or
    modify it under the terms of the GNU Affero General Public License
    as published by the Free Software Foundation, either version 3 of
    the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public
    License along with this program.  If not, see
    <http://www.gnu.org/licenses/>.
*/
/* plotWindow.h: Header file that defines the plotWindow structure. This
 * structure will be passed along with a Grid-structute to plotting
 * functions in plot2d.c. The goal is to let the plotting function have
 * to only decide what is plotted from the data, which comes from a
 * Grid-structure. The function is also passed a plotWindow-structure so
 * it knows in which window are we supposed to plot. */

#ifndef _PLOTWINDOW_H
#define _PLOTWINDOW_H

#include <SDL2/SDL.h>

struct plotWindow {
  char *title;
  int width, height;

  SDL_Window *window;
  SDL_Renderer *renderer;
  SDL_Texture *texture;
  SDL_Surface *surface;

  double minf, maxf;
  double red1, green1, blue1; //this colour corresponds to minf
  double red2, green2, blue2; //this colour corresponds to maxf
};

typedef struct plotWindow plotWindow;

plotWindow* createPlotWindow(int x, int y, int width, int height, char *title);
int wantToStopPlot();
void destroyPlotWindow(plotWindow *plotter);
void quitAllPlotting();

#endif
